import { playerData } from "./playerData";
import { worldData } from "./worldData";

export class DataMgr {

    private static _instance:DataMgr = new DataMgr();
    static Ins()
    {
        return this._instance;
    }

    public dataList:any[] = [];

    init(){
        this.appendModel("PLAYER_DATA", new playerData());
        this.appendModel("WORLD_DATA", new worldData());
    }

    private appendModel(modelName:string, modelIns:any){
        this.dataList[modelName] = modelIns;
    }

    public getModel(modelName){
        return this.dataList[modelName]
    }

    public data(modelName:string)
    {
        return this.dataList[modelName].data;
    }
}
